# 脖子左右，为8号，范围88-168（右-左），中值128
# 脖子上下，为9号，范围50-130（下-上），中值90
class Angle:
    MID_X = 128
    MID_Y = 90
    MAX_X = 168
    MAX_Y = 130
    MIN_X = 88
    MIN_Y = 30

    def __init__(self, x_in, y_in):
        self.x = x_in
        self.y = y_in


def generate_trail(start_anlge, end_angle):
    start_x = start_anlge.x
    start_y = start_anlge.y
    end_x = end_angle.x
    end_y = end_angle.y
    tmp_angles = []
    random_count = 0
    if abs(start_x - end_x) > abs(start_y - end_y):
        random_count = int(abs(start_x - end_x) / 1)
    else:
        random_count = int(abs(start_y - end_y) / 1)

    tmp_angles.append(Angle(start_x, start_y))

    if random_count == 0:
        return tmp_angles

    div_x = (start_x - end_x) / random_count
    div_y = (start_y - end_y) / random_count

    i = 0
    tmp_x = start_x
    tmp_y = start_y
    tmp_angles.append(Angle(int(tmp_x), int(tmp_y)))
    while i < random_count:
        tmp_x -= div_x
        tmp_y -= div_y
        tmp_angles.append(Angle(int(tmp_x), int(tmp_y)))
        i += 1

    return tmp_angles
